export class AuthService {
    // 写入 token 到 localStorage
    static setToken(token: string): void {
        localStorage.setItem('authToken', token);
    }

    // 从 localStorage 读取 token
    static getToken(): string | '' {
        return localStorage.getItem('authToken') || '';
    }

    // 从 localStorage 删除 token
    static removeToken(): void {
        localStorage.removeItem('authToken');
    }

    // 检查是否存在 token
    static isTokenSet(): boolean {
        return this.getToken() !== '';
    }
}